<template>
  <base-breadcrumb :breadcrumb="!isAudit">
    <div class="about-master-container" v-loading="loading">
      <a-card class="mb20">
        <titleName title="会议发起" />
        <BForm
          ref="BForm"
          :config="formConfig"
          :form="form"
          :rule="rules"
          @selectOrg="selectOrg"
        />
      </a-card>
      <a-card class="mb20" v-if="canEdit">
        <a-form-item label="参会者选择：" prop="meetingEmployeeDTOList">
          <div class="mb12">
            <a-button icon="plus" class="btn_right" type="primary" @click="visible = true">
              添加人员
            </a-button>
            <a-button
              :disabled="selectRows.length < 1"
              icon="delete"
              type="danger"
              @click="removePeople(selectRows)"
            >移除
            </a-button>
          </div>
          <div class="pub-table-select-count" style="line-height: 0;">
            <a-icon type="info-circle" theme="twoTone" />
            已选择{{ selectRows.length }}
          </div>
          <b-table
            ref="tableEmployee"
            :columns="columnsEmployee"
            :request="loadDataEmployee"
            :selectConfig="{use: true, type: 'checkbox',rowKey: 'id' }"
            @select-click="selectClick"
          >
            <!-- 表格行操作栏 -->
            <template slot="actions" slot-scope="text, record, index">
              <a @click="removePeople([record])">移除</a>
            </template>
          </b-table>
        </a-form-item>
      </a-card>

      <template v-if="isShowScore">
        <a-card>
          <title-name title="检查隐患项"></title-name>
          <a-button v-if="isEditScore" type="primary" @click="visible2 = true" class="mb20">添加隐患项</a-button>
          <b-table
            :scroll="{x:1376}"
            :show-page="false"
            ref="table"
            :columns="columns"
            :request="loadData"
          >
            <template slot="action" slot-scope="text, record">
              <div class="pub-table-list-action">
                <span  v-if="isEditScore " @click="goDetail(record, 'look')">查看</span>
                <span  v-if="isEditScore " @click="delCheckRecord(record)">删除</span>
                <a-tooltip>
                  <template slot="title">{{ `${record.modelId ? '已' : '未'}关联BIM模型` }}</template>
                  <a-icon @click.stop="handleRelease(record)" type="link" :style="{ color: record.modelId ? '#1890ff' : '#ccc' }" />
                </a-tooltip>
              </div>
            </template>
          </b-table>
        </a-card>

        <a-card v-if="!isDanger">
          <title-name>考核评分</title-name>
          <div class="flex align-items-center mb20">
            得分：
            <b-input-number :value="form.score" disabled :precision="2" />
          </div>
          <a-table
            :pagination="false"
            :columns="columns3"
            :data-source="scoreTableData"
            bordered
          >
            <template slot="html1" slot-scope="text, record">
             <pre
               style="white-space: pre-wrap;font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"
             >{{ text }}
              </pre>
            </template>
            <template slot="input" slot-scope="text, record">
              <b-input v-if="isEditScore " v-model="record['inspectionSituation']" />
              <span v-else>{{ text }}</span>
            </template>
            <template slot="input1" slot-scope="text, record">
              <b-input-number
                v-if="isEditScore"
                :precision="2"
                class="requiredFormItem"
                v-model="record['inspectionScore']"
                @blur="calcScore(record)"
                :min="0"
              />
              <span v-else>{{ text }}</span>
            </template>
          </a-table>
        </a-card>
      </template>

      <div class="tool-btns page-btn-right-top">
        <template v-if="form.meetingEnum === meetingEnum.TOSCORE
        || form.meetingEnum === meetingEnum.CRACKING
        || form.meetingEnum === meetingEnum.HIDDENDANGER
">
          <BasePrintButton
            :before-print-fn="beforePrint"
            style="display: inline-block;"
          />
        </template>
        <template v-if="!disabled">
          <!--          <template v-if="form.meetingEnum === meetingEnum.UNSTART">-->
          <!--            <a-button class="ml20" :loading="loading" type="primary" @click="save(1)">保存草稿</a-button>-->
          <!--          </template>-->
          <template
            v-if="form.meetingEnum === meetingEnum.TOSCORE
            ||form.meetingEnum === meetingEnum.UNSTART
            ||form.meetingEnum === meetingEnum.HIDDENDANGER
"
          >
            <a-button class="ml20" :loading="loading" type="primary" @click="submit(1)">提交</a-button>
          </template>
        </template>
        <a-button class="ml20" @click="$close">关闭</a-button>
      </div>
    </div>
    <SelectPerson
      primary-key="id"
      @getSelectPerson="$refs.tableEmployee.refresh()"
      :list.sync="form.meetingEmployeeDTOList"
      title="选择人员"
      mode="multiple"
      :visible.sync="visible"
    >
    </SelectPerson>

    <seeSign
      :id="form.meetingId"
      :visible.sync="signInVisible"
      :api="LApi.employee"
      @confirm="signInVisible = false"
    />

    <addCheckRecordModal
      :outSelectRows="form.inspectionRectificationListVOS"
      :projectId="form.projectId"
      :visible.sync="visible2"
      @ok="addCheckRecord"
    />
      <!-- 关联BIM模型弹窗 -->
  <BimRelease ref="bimRelease" :zIndex="1002" :destroyOnClose="true" :isRelease="false" :visible.sync="bimVisible" :modelList="modelList" :highLightList="highLightList"/>
  </base-breadcrumb>
</template>
<script>

import SelectSubCompany from '@/components/Select/SelectSubCompany' // 分公司
import SelectProject from '@/components/Select/SelectProject' // 分公司
import SelectPerson from '@/components/Select/SelectPerson'
// import seeSign from './seeSign'
import seeSign from '@/components/seeSign'
import addModal from '@/views/safetySupervision/hazardIdentification/hazardIdentificationList/addModal'
import LApi from '@/api/safetySupervision/checkAndRectify/safeCheckRecord.js'
import ASelectOrgPeople from '@/components/Select/ASelectOrgPeople'
import SelectTreeCommon from '@/components/Select/SelectTreeCommon'
import addCheckRecordModal from './addCheckRecordModal'
import checkLogScoreApi from '@/api/safetySupervision/base/checkLogScore.js'
import BSelect from '@/components/BComponents/BSelect'
import request2 from '@/utils/request2'
import hazardIdentificationApi from '@/api/office/hazardIdentification'
import BimRelease from '@/components/Dialog/BimRelease' // BIM模型关联


let meetingEnum = {
  UNSTART: 'UNSTART',
  ONGOING: 'ONGOING',
  TOSCORE: 'TOSCORE',
  CRACKING: 'CRACKING',
  HIDDENDANGER: 'HIDDENDANGER'
}
export default {
  name: 'a' + Date.now(),
  components: {
    SelectSubCompany,
    SelectProject,
    SelectPerson,
    seeSign,
    addCheckRecordModal,
    addModal,
    BimRelease
  },
  computed: {
    canEdit() {
      if (this.disabled) {
        return false
      }
      return this.form.meetingEnum === this.meetingEnum.UNSTART
    },
    //是否展示表格的那些按钮
    isShowTableBtn() {
      if (this.disabled) {
        return false
      }
      return this.form.meetingEnum === this.meetingEnum.ONGOING
    },
    isShowScore() {
      if (this.disabled) {
        return this.form.meetingEnum === meetingEnum.TOSCORE
          || this.form.meetingEnum === meetingEnum.CRACKING
          || this.form.meetingEnum === meetingEnum.HIDDENDANGER
      }
      return this.$route.query.pageType === 'score' || this.$route.query.pageType === 'danger'
    },
    isDanger() {
      return this.$route.query.pageType === 'danger'
    },
    //是否是编辑评分表
    isEditScore() {
      return this.$route.query.pageType === 'score' || this.$route.query.pageType === 'danger'
    },
    /* eslint-disable */
    formConfig() {
      return [
        {
          row: true,
          children: [
            {
              label: '所属单位',
              type: 'orgTree',
              keyName: 'projectId',
              rules: [{ required: true, message: '请选择项目名称', trigger: 'change' }],
              span: 16,
              isAutoSelectFirst: this.$route.query.pageType === 'add'?true:false,
              isNeedAuth:true ,
              checkStrictly: true,
              disabled: !this.canEdit,
              // isNoBorder: this.editModel == 0,
              // viewName: "viewName",
              // show: this.canEdit
            },
            // {
            //   type: SelectSubCompany,
            //   value: 'branchComId',
            //   label: '分公司',
            //   attrs: {
            //     autoSelected: this.$route.query.pageType === 'add'?true:false,
            //     // getAll: true
            //   },
            //   on: {
            //     selectChange: e => this.form.branchComName = e.orgName
            //   },
            //   show: this.canEdit
            // },
            // {
            //   type: SelectProject,
            //   value: 'projectId',
            //   label: '项目',
            //   attrs: {
            //     isUseChangeEvent: true,
            //     // isSelf: false,
            //     isEdit: this.form.id !== null,
            //     form: this.form,
            //     keyValue: 'branchComId',
            //     isPostpone:true
            //   },
            //   on: {
            //     selectChange: async e => {
            //       if (e) {
            //         this.form.projectName = e.name
            //       }
            //     }
            //   },
            //   show: this.canEdit
            // },
            // { type: 'input', value: 'branchComName', label: '分公司', attrs: { disabled: true }, show: !this.canEdit },
            // { type: 'input', value: 'projectName', label: '项目', attrs: { disabled: true }, show: !this.canEdit },
            { type: 'input', value: 'checkLevel', label: '检查级别', attrs: { disabled: true } },
            {
              type: BSelect, value: 'checkTypeId', label: '检查类型',
              attrs: {
                disabled: !this.canEdit,
                request: async () => {
                  let res = await request2({
                    url: '/cscec-quality-business/quality/types-label',
                    params: { type: '0', code: '0' }
                  })
                  if (res.code === this.SUCCESS_CODE) {
                    return { code: this.SUCCESS_CODE, data: res.data.filter(v => v.enabled) }
                  }
                  return { code: this.SUCCESS_CODE, data: [] }
                }
              },
              on: {
                selectChange: $event => {
                  this.form.checkTypeName = $event.name
                }
              }
            },
            {
              type: ASelectOrgPeople, value: 'organizeId', label: '组织人',
              attrs: {
                disabled: !this.canEdit
              },
              on: {
                onSelectChange: $event => {
                  this.form.organizeName = $event.name
                }
              }
            },
            {
              type: 'date-picker', value: 'startTime', label: '开始时间', attrs: {
                showTime: { format: 'HH:mm' },
                format: 'YYYY-MM-DD HH:mm',
                valueFormat: 'YYYY-MM-DD HH:mm:ss',
                disabled: !this.canEdit
              }
            },
            {
              type: SelectTreeCommon, value: 'respAreaId', label: '检查区域',
              attrs: {
                isEdit: this.form.id !== null,
                form: this.form,
                params: { sources: 0 },
                linkParamsKey: 'id',
                api: e => hazardIdentificationApi.subPackArea({}, e)
              },
              show: this.canEdit
            },
            { type: 'input', value: 'respAreaName', label: '检查区域', attrs: { disabled: true }, show: !this.canEdit },
            {
              type: 'custom',
              value: 'shouldNum',
              label: this.form.meetingEnum === meetingEnum.ONGOING ? '应参会人数' : '实际参会人数',
              show: this.form.meetingEnum !== meetingEnum.UNSTART,
              render: () => {
                return (
                  <div style="display: flex;align-items: center;">
                    <b-input disabled
                             value={(this.form.meetingEnum === meetingEnum.ONGOING ? this.form.shouldNum : this.form.realNum) || 0}
                    />
                    <a-button style="margin-left:20px" type="primary"
                              onClick={e => this.signInVisible = true}
                    >
                      查看签到
                    </a-button>
                    <a-button style="margin-left:20px" type="primary" onClick={this.handleLargeScreen}>会议大屏</a-button>
                  </div>
                )
              }
            },
            {
              type: 'custom', value: 'fileInfoList', label: '照片上传', colSpan: 24, noFixed: true,
              show: this.form.meetingEnum !== meetingEnum.UNSTART,
              render: () => {
                return <b-upload2 uploadType="image-list"
                                  disabled={true}
                                  maxUploadCount={2}
                                  businessCode="UN09"
                                  v-model={this.form.fileInfoVOS}
                />
              }
            }
          ]
        }
      ]
    }
  },
  props: {
    isAudit: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    isAudit: {
      handler(val) {
        if (val) {
          this.disabled = true
        }
      },
      immediate: true
    }
  },
  data() {
    return {
      LApi,
      columns3: [
        {
          title: '考核类别', dataIndex: 'checkName', width: 150,
          customRender: (text, row, index) => {
            //大体逻辑，在数组中第一条和最后一条的下标不同，那么就是有多条的，反之
            let lastIndex = -1
            this.scoreTableData.map((v, i) => {
              if (v.checkName === text) {
                lastIndex = i
              }
            })
            let firstIndex = this.scoreTableData.findIndex(v => v.checkName === text)
            // console.log(lastIndex)
            // console.log(firstIndex)
            let obj = { children: text, attrs: { rowSpan: 1 } }
            if (index === 0) {
              obj.attrs.rowSpan = lastIndex === firstIndex ? 1 : (lastIndex + 1) - firstIndex
            } else {
              // 若该行考核内容和上一行一致，则使其隐藏
              if (this.scoreTableData[index - 1].checkName === text) {
                obj.attrs.rowSpan = 0
                // 若不是，则往下合并与改行内容一致行的总行数
              } else {
                obj.attrs.rowSpan = lastIndex === firstIndex ? 1 : (lastIndex + 1) - firstIndex
              }
            }
            return obj
          }
        },
        { title: '考核内容', dataIndex: 'assessmentContent', width: 150 },
        { title: '考核细则', dataIndex: 'assessmentRules', width: 300, scopedSlots: { customRender: 'html1' } },
        { title: '得分标准', dataIndex: 'scoreCriteria', width: 300, scopedSlots: { customRender: 'html1' } },
        { title: '得分', dataIndex: 'score', width: 80 },
        { title: '公司考核情况', dataIndex: 'inspectionSituation', width: 180, scopedSlots: { customRender: 'input' } },
        { title: '公司考核得分', dataIndex: 'inspectionScore', width: 180, scopedSlots: { customRender: 'input1' } }
      ],
      scoreTableData: [],
      meetingEnum,
      beforePrint: async e => {
        let res = await LApi.print({ id: this.form.id })
        return res.data.content
      },
      loading: false,
      signInVisible: false,

      disabled: this.$route.query.pageType === 'look',
      form: {
        id: null,
        score: '',
        checkLevel: '公司级',
        organizeId: '',
        meetingEnum: meetingEnum.UNSTART,
        respAreaId: '',
        meetingEmployeeDTOList: [],
        inspectionRectificationListVOS: [],
        fileInfoList: []
      },
      rules: {
        branchComId: [{ required: true, message: '请选择分公司', trigger: 'change' }],
        projectId: [{ required: true, message: '请选择项目', trigger: 'change' }],
        checkTypeId: [{ required: true, message: '请选择检查类型', trigger: 'change' }],
        organizeId: [{ required: true, message: '请选择组织人', trigger: 'change' }],
        startTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
        respAreaId: [{ required: true, message: '请选择检查区域', trigger: 'change' }]
      },
      visible: false,
      selectRows: [],
      columnsEmployee: [
        { title: '员工名称', dataIndex: 'name' },
        { title: '电话号码', dataIndex: 'phone' },
        {
          title: '操作',
          dataIndex: 'actions',
          width: '100px',
          scopedSlots: { customRender: 'actions' }
        }
      ],
      loadDataEmployee: (parameter) => {
        return new Promise((resolve, reject) => {
          let obj = {}
          obj.code = 200
          obj.currentPage = parameter.pageNo
          obj.pageSize = parameter.pageSize
          obj.totalPage = Math.ceil(this.form.meetingEmployeeDTOList.length / parameter.pageSize)
          obj.totalSize = this.form.meetingEmployeeDTOList.length
          obj.data = this.form.meetingEmployeeDTOList || []
          // console.log(obj)
          resolve(obj)
        })
      },
      columns: [
        { title: '检查区域', dataIndex: 'respAreaStr', width: 250 },
        {
          title: '检查类型', dataIndex: 'typeName', width: 150,
          customRender: (text, row, index) => {
            let list = []
            if (text) {
              list = text.split(',')
            }
            return <div>
              {list.map(v => {
                return <div>{v}</div>
              })}
            </div>
          }
        },
        { title: '问题描述', dataIndex: 'problemDescription', width: 150 },
        { title: '问题等级', dataIndex: 'securityControlEnumStr', width: 100 },
        { title: '隐患类型', dataIndex: 'treeLabelStr', width: 150 },
        { title: '检查人', dataIndex: 'creatorName', width: 150 },
        { title: '检查时间', dataIndex: 'createTime', width: 200 },
        { title: '责任分包单位', dataIndex: 'subcontractorName', width: 150 },
        { title: '整改人', dataIndex: 'rectificationUserName', width: 100 },
        { title: '整改期限', dataIndex: 'rectificationTime', width: 200 },
        {
          title: '状态', dataIndex: 'safetyAuditStatusEnumStr', width: 100, customRender: (text, row, index) => {
            if (row.safetyAuditStatusEnumStr === '待整改' && row.isBeyond == '1') {
              return '超期未整改'
            }
            return row.safetyAuditStatusEnumStr
          }
        },
        {
          title: '操作',
          dataIndex: 'action',
          width: 120,
          fixed: 'right',
          scopedSlots: { customRender: 'action' }
        }
      ],
      loadData: p => {
        return { code: 200, data: this.form.inspectionRectificationListVOS }
      },
      visible2: false,
      bimVisible:false,
      modelList: [],
      highLightList:'',
    }
  },
  mounted() {
    if (this.$route.query.id) {
      this.form.id = this.$route.query.id
      this.getData()
    } else {
      if (this.$userType() === 'CO') this.form.checkLevel = '公司级'
      if (this.$userType() === 'BC') this.form.checkLevel = '分公司级'
      if (this.$userType() === 'PD') this.form.checkLevel = '项目级'
    }
  },
  methods: {
    selectOrg(val) {
      this.form.branchComId = val[val.length - 2].orgId
      this.form.branchComName = val[val.length - 2].orgName
      this.form.projectName = val[val.length - 1].projectName
      this.form.projectId = val[val.length - 1].projectId
    },
    async getData() {
      this.loading = true
      let res = await LApi.findById({ id: this.form.id })
      this.loading = false
      if (res.code === this.SUCCESS_CODE) {
        this.form = res.data
        if (this.form.meetingEmployeeDTOList) {
          this.form.meetingEmployeeDTOList.map(v => {
            v.id = v.userId
          })
        } else {
          this.form.meetingEmployeeDTOList = []
        }
        this.$refs.tableEmployee && this.$refs.tableEmployee.refresh()

        if (!this.form.fileInfoList) {
          this.form.fileInfoList = []
        }
        if (!this.form.inspectionRectificationListVOS) {
          this.form.inspectionRectificationListVOS = []
        }
        if (!this.form.meetingCheckRecordMarkSheetDTOS) {
          let res1 = await checkLogScoreApi.findListByMain()
          if (res1.code === this.SUCCESS_CODE) {
            let resRow
            if (this.form.checkLevel === '公司级') {
              resRow = res1.data.find(v => v.isBranchCom === '1')
            } else {
              resRow = res1.data.find(v => v.isBranchCom === '0')
            }
            if (resRow) {
              let res2 = await checkLogScoreApi.findById({ id: resRow.id })
              if (res2.code === this.SUCCESS_CODE) {
                res2.data.checkRecordMarkSheetDTOS.map(v => {
                  if (v.checkRecordMarkSheetDetailsDTOS) {
                    let temp = []
                    v.checkRecordMarkSheetDetailsDTOS.map(w => {
                      w.checkName = v.checkName
                      w.accounted = v.accounted
                      w.checkScore = v.checkScore
                      temp.push(w)
                    })
                    this.scoreTableData = this.scoreTableData.concat(temp)
                  }
                })
                this.calcScore()
              }
            } else {
              this.$noticeWarning('获取评分表失败！')
            }
          }
        } else {
          this.form.meetingCheckRecordMarkSheetDTOS.map(v => {
            if (v.meetingCheckRecordMarkSheetDetailsDTOS) {
              let temp = []
              v.meetingCheckRecordMarkSheetDetailsDTOS.map(w => {
                w.checkName = v.checkName
                w.accounted = v.accounted
                w.checkScore = v.checkScore
                temp.push(w)
              })
              this.scoreTableData = this.scoreTableData.concat(temp)
            }
          })
          this.calcScore()
          // this.$console(this.scoreTableData)
        }
        if (this.isEditScore) {
          this.$refs.table && this.$refs.table.refresh()
        }
      }
    },
    async checkValidate() {
      return new Promise(resolve => {
        this.$refs.BForm.validate((valid) => {
          resolve(valid)
        })
      })
    },
    calcScore(row) {
      if (this.form.meetingEnum !== meetingEnum.TOSCORE) return
      if (row && row.inspectionScore) {
        if (row.score < row.inspectionScore) {
          row.inspectionScore = ''
          return this.$noticeWarning('公司考核得分不能大于得分')
        }
      }
      this.form.score = this.scoreTableData.reduce((acc, cur) => {
        if (cur.inspectionScore) {
          acc += Number(cur.inspectionScore) * (Number(cur.accounted) / 100) || 0
        }
        return acc
      }, 0)
    },
    async editScore() {
      let temp = {
        'baseId': this.form.id,
        'ids': this.form.inspectionRectificationListVOS.map(v => v.id),
        'meetingCheckRecordMarkSheetDTOS': [],
        score: this.form.score
      }

      let tempScoreTableData = this.$clone(this.scoreTableData)
      tempScoreTableData.map(v => {
        delete v.id
      })

      tempScoreTableData.map(v => {
        let resIndex = temp.meetingCheckRecordMarkSheetDTOS.findIndex(w => w.checkName === v.checkName)
        if (resIndex === -1) {
          temp.meetingCheckRecordMarkSheetDTOS.push({
            ...v,
            meetingCheckRecordMarkSheetDetailsDTOS: [v]
          })
        } else {
          temp.meetingCheckRecordMarkSheetDTOS[resIndex].meetingCheckRecordMarkSheetDetailsDTOS.push(v)
        }
      })
      this.loading = true
      let res = await LApi.editExamineGrade({}, temp)
      this.loading = false
      if (res.code === this.SUCCESS_CODE) {
        this.$noticeSuccess('操作成功')
        this.$close()
      }
    },
    async save(status) {
      if (this.isEditScore) {
        return this.editScore()
      }
      let temp = this.$clone(this.form)
      delete temp.score
      temp.status = status
      temp.meetingEmployeeDTOList.map(v => {
        v.userId = v.id
        v.signIn = false
        v.signType = 0
        v.signUser = v.name
        delete v.id
      })

      let res
      this.loading = true
      if (temp.id) {
        res = await LApi.editByMain({}, temp)
      } else {
        res = await LApi.createByMain({}, temp)
      }
      this.loading = false
      if (res.code === this.SUCCESS_CODE) {
        this.form.id = res.data.id
        this.$noticeSuccess('操作成功')
        this.$close()
        // this.getData()
      }
    },
    async submit(status) {
      if (await this.checkValidate()) {
        await this.save(status)
      }
    },
    addCheckRecord(e) {
      this.form.inspectionRectificationListVOS = this.form.inspectionRectificationListVOS.concat(e)
      this.$refs.table.refresh()
    },
    delCheckRecord(row) {
      this.$submitConfirm(() => {
        let resIndex = this.form.inspectionRectificationListVOS.findIndex(v => v.id === row.id)
        if (resIndex !== -1) {
          this.form.inspectionRectificationListVOS.splice(resIndex, 1)
          this.$refs.table.refresh()
        }
      }, '确定删除数据？')
    },
    goDetail(record, pageType) {
      this.$router.push({
        path: '/safetySupervision/checkAndRectify/checkRecord/detail',
        query: {
          id: record.id,
          pageType,
          ignoreNoTab: 1,
          history: JSON.stringify([
            {
              title: '检查记录',
              path: '/safetySupervision/checkAndRectify/checkRecord'
            },
            {
              title: '检查记录详情',
              path: '/safetySupervision/checkAndRectify/checkRecord/detail'
            }
          ])
        }
      })
    },
    selectClick(e) {
      let { rows, keys } = e
      this.selectRows = rows
    },
    removePeople(rows) {
      this.$submitConfirm(() => {
        rows.map(v => {
          let resIndex = this.form.meetingEmployeeDTOList.findIndex(w => w.id === v.id)
          if (resIndex !== -1) {
            this.form.meetingEmployeeDTOList.splice(resIndex, 1)
          }
        })
        this.selectRows = []
        this.$refs.tableEmployee.refresh(true)
      }, '确定移除?')
    },
    async handleLargeScreen() {
      let res = await LApi.findErWeiById({ id: this.form.meetingId })
      if (res.code === this.SUCCESS_CODE) {
        let routeData = this.$router.resolve({
          path: '/conferenceScreen',
          query: {
            meetingName: this.form.meetingName,
            branchComName: this.form.branchComName,
            projectName: this.form.projectName,
            meetingPlace: this.form.meetingPlace,
            startTime: this.form.meetTime,
            orCode: res.data
          }
        })
        window.open(routeData.href, '_blank')
      }
    },
    /**
    * @description: 查看关联的BIM模型
     * @param {*} record：业务对象
     * @return {*}
     */
     handleRelease(record) {
      if (record.modelId) {
        this.modelList = [{ id: record.modelId, modelId: record.modelFileId, version: record.modelFileVersion, modelTitle: record.modelTitle, uuId: [record.bimId?.split('&&&&')?.[1]], subAreaId: record.subAreaId }];
        this.highLightList = record.bimId?.split('&&&&')?.[0];
        this.bimVisible = true
      }
    },
  }
}
</script>
